#include <iostream>
#include "quote.h"
#include <string>
#include <ostream>
#include <vector>
#include <memory>

using namespace std;

void pr_15_28()
{
    vector<Quote> itemVec;
    for (size_t i = 0; i != 10; ++i) {
        Bulk_quote item("C++ Primer", 6, 5, 0.5);
        itemVec.push_back(item);
    }
    double sum = 0.0;
    for (vector<Quote>::iterator iter = itemVec.begin(); iter != itemVec.end();
         ++iter) {
        sum += iter->net_price(10);
    }
    cout << sum << endl;
}

void pr_15_29()
{
    vector<shared_ptr<Quote>> itemVec;
    for (size_t i = 0; i != 10; ++i) {
        itemVec.push_back(make_shared<Bulk_quote>("C++ Primer", 6, 5, 0.5));
    }
    double sum = 0.0;
    for (auto iter = itemVec.begin(); iter != itemVec.end(); ++iter) {
        sum += (*iter)->net_price(10);
    }
    cout << sum << endl;
}

int main()
{
    pr_15_28();
    pr_15_29();
    return 0;
}
